﻿using BCEntity.TMS.MarketingCoupon.MarketingCouponUsing;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.MarketingCoupon.MarketingCouponUsing
{
    public interface IMarketingCouponUsingData
    {
        /// <summary>
        /// 检查优惠券是否已使用
        /// </summary>
        /// <param name="marketingCouponId">优惠券Id</param>
        /// <returns></returns>
        Task<bool> Exists(long marketingCouponId);
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity">优惠券使用记录</param>
        /// <returns></returns>
        Task<MarketingCouponUsingEntity> InsertAsync(MarketingCouponUsingEntity entity);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity">优惠券使用记录</param>
        /// <returns></returns>
        Task<MarketingCouponUsingEntity> UpdateAsync(MarketingCouponUsingEntity entity);
        /// <summary>
        /// 获取信息
        /// </summary>
        /// <param name="marketingCouponUsingId">优惠券使用记录Id</param>
        /// <returns></returns>
        Task<MarketingCouponUsingEntity> GetSingle(long marketingCouponUsingId);

        /// <summary>
        /// 获取分页
        /// </summary>
        /// <param name="isEnabled">是否启用</param>
        /// <param name="couponMinAmount">优惠最小金额</param>
        /// <param name="couponMaxAmount">优惠最大金额</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(IEnumerable<MarketingCouponUsingEntity>, int)> Query(
            long? marketingCouponTypeId, long? userId, int pageIndex, int pageSizee);
        /// <summary>
        /// 获取信息根据优惠券id
        /// </summary>
        /// <param name="marketingCouponId">优惠券Id</param>
        /// <returns></returns>
        Task<MarketingCouponUsingEntity> GetSingleByCouponId(long marketingCouponId);
    }
}
